<div>
  <h3>Keycloak登录与登出</h3>

  <nz-alert nzBanner nzType="error" nzMessage="未登录" *ngIf="!isLoggedIn"></nz-alert>
  <nz-alert nzBanner nzType="success" nzMessage="已成功登录" *ngIf="isLoggedIn"></nz-alert>

  <br />
  <nz-alert nzType="info" nzMessage="操作指南" nzDescription="点击'登录'按钮，会跳转到登录页面，登录后，自动跳转到本页面并显示登录成功" nzShowIcon></nz-alert>

  <br />
  <button nz-button nzType="primary" (click)="logout()" *ngIf="isLoggedIn">
    <i nz-icon nzType="logout"></i>
    登出
  </button>
  <button nz-button nzType="primary" (click)="login()" *ngIf="!isLoggedIn">
    <i nz-icon nzType="login"></i>
    登录
  </button>
</div>